import {ReqGetGoodsList} from "@/api"

// 存储数据
const state = {
    goods:{}
}

const mutations = {
    // 存储获取商品数据
    SAVE_GOODS_LIST(state,value){
        state.goods = value
    }   
}

const actions = {
    // 请求获取商品数据
    async getGoodsList({commit},params){
        // console.log(params)
        let data = await ReqGetGoodsList(params);
        // console.log(data);
        commit("SAVE_GOODS_LIST",data);
    }
}

const getters = {

}

export default {
    namespaced:true,
    state,
    mutations,
    actions,
    getters
}